package com.zxy.springboot_goods.controller;


import com.zxy.springboot_goods.config.AjaxResult;
import com.zxy.springboot_goods.entity.Product;
import com.zxy.springboot_goods.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lenovo
 * @since 2021-11-01
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private IProductService productService;

    @RequestMapping("getProduct")
    public AjaxResult getProduct(){
        List<Product> list = productService.list(null);
        return AjaxResult.ok(list);
    }
}
